import React, { Component } from 'react';

import Unit from '../../unit';


class View extends Component {

    constructor(props){
        super(props);
        this.state = {
            page:1
        }
    }
    testState(){
        // this.setState(function(state, props) {
        //     return {
        //         page: state.page + props.page
        //     };
        // });
        this.setState((state, props)=>({
            page: state.page + props.page
        }))

    }
    componentDidMount(){
        setTimeout(()=>{
            this.testState()
        },3000)
    }
    // 
    render(){
        return(
            <div>
                111---{this.state.page}
            </div>
        )
    }
}

export default View;
